package com.ruoyi.warehouse.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.warehouse.mapper.DrugWarehouseMapper;
import com.ruoyi.warehouse.domain.DrugWarehouse;
import com.ruoyi.warehouse.service.IDrugWarehouseService;

/**
 * 药库Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-08-22
 */
@Service
public class DrugWarehouseServiceImpl implements IDrugWarehouseService 
{
    @Autowired
    private DrugWarehouseMapper drugWarehouseMapper;

    /**
     * 查询药库
     * 
     * @param warehouseId 药库主键
     * @return 药库
     */
    @Override
    public DrugWarehouse selectDrugWarehouseByWarehouseId(Long warehouseId)
    {
        return drugWarehouseMapper.selectDrugWarehouseByWarehouseId(warehouseId);
    }

    /**
     * 查询药库列表
     * 
     * @param drugWarehouse 药库
     * @return 药库
     */
    @Override
    public List<DrugWarehouse> selectDrugWarehouseList(DrugWarehouse drugWarehouse)
    {
        return drugWarehouseMapper.selectDrugWarehouseList(drugWarehouse);
    }

    /**
     * 新增药库
     * 
     * @param drugWarehouse 药库
     * @return 结果
     */
    @Override
    public int insertDrugWarehouse(DrugWarehouse drugWarehouse)
    {
        return drugWarehouseMapper.insertDrugWarehouse(drugWarehouse);
    }

    /**
     * 修改药库
     * 
     * @param drugWarehouse 药库
     * @return 结果
     */
    @Override
    public int updateDrugWarehouse(DrugWarehouse drugWarehouse)
    {
        return drugWarehouseMapper.updateDrugWarehouse(drugWarehouse);
    }

    /**
     * 批量删除药库
     * 
     * @param warehouseIds 需要删除的药库主键
     * @return 结果
     */
    @Override
    public int deleteDrugWarehouseByWarehouseIds(Long[] warehouseIds)
    {
        return drugWarehouseMapper.deleteDrugWarehouseByWarehouseIds(warehouseIds);
    }

    /**
     * 删除药库信息
     * 
     * @param warehouseId 药库主键
     * @return 结果
     */
    @Override
    public int deleteDrugWarehouseByWarehouseId(Long warehouseId)
    {
        return drugWarehouseMapper.deleteDrugWarehouseByWarehouseId(warehouseId);
    }
}
